<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="../common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="../CSS/style.css" rel="stylesheet">
    </head>
    <body>
<%    request.setCharacterEncoding("utf-8");
   if(request.getParameter("ISBN")!=""){

	String ISBN=request.getParameter("ISBN");
	String bookname=request.getParameter("bookname");
	String writer=request.getParameter("writer");	;	
	String TPI=request.getParameter("TPI");
        int pDate=Integer.parseInt(request.getParameter("pDate"));
	String cover=request.getParameter("cover");
     float price=Float.valueOf(request.getParameter("price")).floatValue();	
        String introduce = request.getParameter("introduce");
        if (introduce.equals("")) {
            introduce = "暂无";
        }
        BookDetails book = new BookDetails();
        book.setBookid(ISBN);
        book.setCover(cover);
        book.setDescription(introduce);
      book.setYear(pDate);
        book.setTitle(bookname);
        book.setPrice(price);
        book.setName(writer);
        book.setPubilsher(TPI);
       int ret=bookDB.update(book);	
       if (ret==0){
		out.println("<script language='javascript'>alert('图书信息修改成功！');window.location.href='index.jsp';</script>");
		}else{
		out.println("<script language='javascript'>alert('图书信息修改失败！');window.location.href='index.jsp';</script>");
	}
}
%>
    </body>

</html>
